<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="../js/vue.js"></script>
</head>
<body>
<div id="root">
    <p>{{info.name}}</p>
    <p>{{info.age}}</p>
    <p>{{info.gender}}</p>
    <p>{{info.myCity}}</p>
    <button @click="fn">按钮</button>
</div>
<script>
    Vue.config.productionTip = false;
    const vm = new Vue({
        el: "#root",
        data: {
            info: {
                name: '查小兵',
                age: 24,
                gender: '男'
            }
        },
        methods: {
            fn(){
                this.$set(this.info,'myCity','上海');
            }
        }
    })
</script>
</body>
</html>
